﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using IUAP.DAL;

/// <summary>
/// Descripción breve de BaseArticle
/// </summary>
namespace IUAP.BLL.Articulo
{
    public abstract class BaseArticulo : BizObject
    {
        //public BaseArticle()
        //{

        //}
        private int id = 0;

        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        private DateTime fecha = DateTime.Now;

        public DateTime Fecha
        {
            get { return fecha; }
            set { fecha = value; }
        }

        private string usuario = "";

        public string Usuario
        {
            get { return usuario; }
            set { usuario = value; }
        }
        protected static ArticulosElement Settings
        {
            get { return Globals.Settings.Articulo; }
        }
        
        protected static void CacheData(string key, object data)
        {
            if (Settings.EnableCaching && data != null)
            {
                BizObject.Cache.Insert(key, data, null,
                   DateTime.Now.AddSeconds(Settings.CacheDuration), TimeSpan.Zero);
            }
        }
    }
}